home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
dbms_mag
/
9104
/
lief1.apr
< prev
next >
Wrap
Text File
|
1991-03-04
|
800b
|
34 lines
Listing 1:
Caption: Some example code blocks that do not use parameters.
local myblock := { | | qout(mvar) }, mvar := "testing"
eval(myblock) // output: "testing"
local myblock := {|| 5000 }
x := eval(myblock)
? x // output: 5000
local myblock := { | | x++ }
for y := 1 to 100
eval(myblock) // crashes because X not defined
next
? x
local myblock := { | | x++ }, x := 1 // much nicer thanks
for y := 1 to 100
eval(myblock)
next
? x // output: 101
local myblock := { | | BlueFunc() }
eval(myblock) // calls BlueFunc() which displays a message
return nil
static function bluefunc
? "here we are in a BlueFunc() - will we ever escape?"
inkey(5)
return nil